using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace UM_Model.Models.Mapping
{
    public class AlbumMap : EntityTypeConfiguration<Album>
    {
        public AlbumMap()
        {
            // Primary Key
            this.HasKey(t => t.AlbumID);

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(100);

            // Table & Column Mappings
            this.ToTable("Albums");
            this.Property(t => t.AlbumID).HasColumnName("AlbumID");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.IsEnable).HasColumnName("IsEnable");
        }
    }
}
